package com.sunda.spmsweb.wmscontroller;


import com.sunda.spmscommon.ResponseResult;
import com.sunda.spmswms.service.ISapDeliveryNoteDtlService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * SAP交货单表明细 前端控制器
 * </p>
 *
 * @author Wayne
 * @since 2021-03-19
 */
@RestController
@RequestMapping("/sapDeliveryNoteDtl")
@Api(tags = "交货单明细接口", description = "交货单明细接口")
public class SapDeliveryNoteDtlController {
    @Autowired
    ISapDeliveryNoteDtlService iSapdeliveryNotesDtlService;


    @RequestMapping("/getSapDeliveryNoteDtlBySapDN")
    @ApiOperation(value = "获取SAP DN单详情信息(贸易货)",notes = "获取SAP DN单详信息(贸易货) \n" +
            "deliveryNoteSap, SAP DN单号示例：1180066360 \n",httpMethod = "GET")
    public ResponseResult getSapDeliveryNoteDtlBySapDN(@RequestParam String deliveryNoteSap){

        try {
            return ResponseResult.success().add("SapDeliveryNoteDtl",iSapdeliveryNotesDtlService.getDeliveryNoteDtlBySapDN(deliveryNoteSap));
        }catch (Exception e){
            e.printStackTrace();
            return ResponseResult.error("获取SAP DN详情失败");
        }
    }
}
